import request from '@/utils/request';

/**
 * 查询刷题列表
 * @param query
 * @returns {*}
 */

export const listQuestions = (query)=> {
  return request({
    url: '/bykt/questions/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询刷题详细
 * @param id
 */
export const getQuestions = (id: string | number) => {
  return request({
    url: '/bykt/questions/' + id,
    method: 'get'
  });
};

/**
 * 新增刷题
 * @param data
 */
export const addQuestions = (data) => {
  return request({
    url: '/bykt/questions',
    method: 'post',
    data: data
  });
};

/**
 * 修改刷题
 * @param data
 */
export const updateQuestions = (data) => {
  return request({
    url: '/bykt/questions',
    method: 'put',
    data: data
  });
};

/**
 * 删除刷题
 * @param id
 */
export const delQuestions = (id: string | number | Array<string | number>) => {
  return request({
    url: '/bykt/questions/' + id,
    method: 'delete'
  });
};

// /bykt/questions/export

export const exportQuestions = (query) => {
  return request({
    url: '/bykt/questions/export',
    method: 'post',
    params: query,
    responseType: 'blob'
  });
};
